<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function delConfirm() {
		var result=window.confirm("确定要删除吗？")
		return result;
	}
</script>
</head>
<body>
<table border="1px" align="center" width="70%" cellpadding="0" cellspacing="0">
	<tr align="center">
		<td>编号</td>
		<td>权限名称</td>
		<td>权限路径</td>
		<td>父权限</td>
		<td>操作</td>
	</tr>
	<c:forEach var="function" items="${functionPage.functionList }" varStatus="functionstatus">
		<tr align="center">
			<td>${functionstatus.count }</td>
			<td>${function.functionName }
			<td>
				<c:if test="${empty function.functionPath }">/</c:if>
				<c:if test="${function.functionPath!=null }">
					${function.functionPath }
				</c:if>
			</td>
			<td>
				<c:if test="${empty function.fatherFunction }">/</c:if>
				<c:if test="${function.fatherFunction!=null }">
					${function.fatherFunction.functionName }
				</c:if>
			</td>
			<td>
				<a href="${pageContext.request.contextPath }/servlet/updatefunctionpageservlet?id=${function.functionId}">更新</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="${pageContext.request.contextPath }/servlet/delectfunctionservlet?id=${function.functionId}">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td colspan="5" align="right">
			共${functionPage.pageNum }页&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="${pageContext.request.contextPath }/servlet/showfunctionservlet?currentPage=1">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="${pageContext.request.contextPath }/servlet/showfunctionservlet?currentPage=${functionPage.prePage}">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<c:forEach begin="1" end="${functionPage.pageNum }" var="page">
			<a href="${pageContext.request.contextPath }/servlet/showfunctionservlet?currentPage=${page}">${page }</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</c:forEach>
			<a href="${pageContext.request.contextPath }/servlet/showfunctionservlet?currentPage=${functionPage.nextPage}">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			<a href="${pageContext.request.contextPath }/servlet/showfunctionservlet?currentPage=${functionPage.pageNum}">尾页</a>&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
	</tr>
</table>
</body>
</html>